package edu.dublbo.app.generator.util;

/**
 * @author DubLBo
 * @since 2020-09-05 18:22
 * i believe i can i do
 */
public class Constant {
    public static final int LOGIC_DELETE_VAL = 1;
    public static final int LOGIC_NOT_DELETE_VAL = 0;
    public static final String CURRENT_USER = "admin";
    public static final String ORDER_ASC = "asc";
    public static final String ORDER_DESC = "desc";

    /**
     * 就是用来生成明细表里的序号啦。。。。
     */
    public static final Integer MODEL_DETAIL_SORTNO_MIN_POS = 996;
    public static final Integer MODEL_DETAIL_SORTNO_MAX_POS = 1000;

    public static final String CODE_AUTHOR = "code-robot";

//    public static final String CACHE_FILE_PATH = "src/main/resources/cache/cache";
    public static final String TEMPLATE_DIR = "src/main/resources/tpls/";
//    public static final int TEMPLATE_FILE_COUNT = 6;

    public static final String FILE_NAME_TABLE_TF = "table_template.txt";
    public static final String FILE_NAME_ENTITY_TF = "entity_template.txt";
    public static final String FILE_NAME_MAPPER_INTER_TF = "mapper_inter_template.txt";
    public static final String FILE_NAME_MAPPER_XML_TF = "mapper_xml_template.txt";
    public static final String FILE_NAME_SERVICE_TF = "service_template.txt";
    public static final String FILE_NAME_CONTROLLER_TF = "controller_template.txt";
    public static final String FILE_NAME_POM_TF = "pom_template.txt";
    public static final String FILE_NAME_APP_CONFIG_TF = "application_template.yml.txt";
    public static final String FILE_NAME_MYBATIS_CONFIG_TF = "mybatis_template.xml.txt";

    public static final int INDEX_TABLE_TF = 0;
    public static final int INDEX_ENTITY_TF = 1;
    public static final int INDEX_MAPPER_INTER_TF = 2;
    public static final int INDEX_MAPPER_XML_TF = 3;
    public static final int INDEX_SERVICE_TF = 4;
    public static final int INDEX_CONTROLLER_TF = 5;
    public static final int INDEX_POM_TF = 6;
    public static final int INDEX_APP_CONFIG_TF = 7;
    public static final int INDEX_MYBATIS_TF = 8;

    public static final String[] FILE_PATH_TEMPLATES = {
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_TABLE_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_ENTITY_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_MAPPER_INTER_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_MAPPER_XML_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_SERVICE_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_CONTROLLER_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_POM_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_APP_CONFIG_TF,
            Constant.TEMPLATE_DIR + Constant.FILE_NAME_MYBATIS_CONFIG_TF,
    };

    public static final String[] TAGS_TABLE_TF = {
            "#{user}",
            "#{curTime}",
            "#{remark}",
            "#{tableName}",
            "#{newAddColumns}"
    };
    public static final String[] TAGS_ENTITY_TF = {
            "#{packageDir}",
            "#{importZone}",
            "#{remark}",
            "#{user}",
            "#{curTime}",
            "#{className}",
            "#{propertyZone}",
            "#{getAndSetMethod}",
            "#{toStringZone}"
    };
    public static final String[] TAGS_MAPPER_INTER_TF = {
            "#{packageDir}",
            "#{modelName}",
            "#{remark}",
            "#{user}",
            "#{curTime}",
            "#{mapperName}"
    };
    public static final String[] TAGS_MAPPER_XML_TF = {
            "{{packageDir}}",
            "{{mapperName}}",
            "{{tableName}}",
            "{{columnNameItems}}",
            "{{modelName}}",
            "{{resultMapZone}}",
            "{{conditionZone}}",
            "{{aliasConditionZone}}",
            "{{insertColItems}}",
            "{{updateColItems}}",
    };
    public static final String[] TAGS_SERVICE_TF = {
            "#{packageDir}",
            "#{modelName}",
            "#{mapperName}",
            "#{remark}",
            "#{user}",
            "#{curTime}",
            "#{serviceName}"
    };
    public static final String[] TAGS_CONTROLLER_TF = {
            "#{packageDir}",
            "#{modelName}",
            "#{serviceName}",
            "#{remark}",
            "#{user}",
            "#{curTime}",
            "#{requestPath}",
            "#{controllerName}"
    };
}
